package com.su.currency.core;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class FileQueue {

	private BlockingQueue<String> mQueue;

	public FileQueue() {
		mQueue = new LinkedBlockingQueue<String>(20);
	}

	public void addString(String string) {
		boolean flag = false;
		try {
			System.out.println("start add"+string);
			mQueue.put(string);
			System.out.println("end add"+string);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void remove() {
		synchronized (mQueue) {
			System.out.println("start to poll");
			String poll = mQueue.poll();
			System.out.println("poll from queque" + poll);

		}

	}
}
